package lium.lbs.lbsim.utils;

import android.widget.Toast;
import com.lmlibrary.base.BaseApplication;
import lium.lbs.lbsim.App;


/**
 * Description:
 * User: niexg
 * Date: 2018-07-30
 * Time: 14:14
 */
public class ToastUtils {

    private static Toast mToast;

    public static Toast getSingletonToast(String text, int time) {
        if (mToast == null) {
            mToast = Toast.makeText(App.getContext(), "", time);
        }
        mToast.setText(text);
        mToast.setDuration(time);
        return mToast;
    }


    public static Toast showToast(String text) {
        getSingletonToast(text, Toast.LENGTH_SHORT).show();
        return mToast;
    }

    public static Toast showLongToast(String text) {
        getSingletonToast(text, Toast.LENGTH_LONG).show();
        return mToast;
    }

}
